import React, { FC, useCallback, useState } from "react"
import { text } from "stream/consumers"
const Demo: FC = () => {
  const [text, setText] = useState("hello")
  const fn1 = () => console.log("fn1 text", text)
  const fn2 = useCallback(() => {
    console.log("fn2", text)
  }, [text])
  return (
    <>
      <div>
        <button onClick={fn1}>fn1</button>
        <button onClick={fn2}>fn2</button>
      </div>
      <div>
        <input type="text" />
      </div>
    </>
  )
}
export default Demo
